package edu.xlh.travel.service;

import com.alipay.api.AlipayApiException;
import edu.xlh.travel.common.Result;
import edu.xlh.travel.pojo.Hotel_orders;
import edu.xlh.travel.pojo.querypojo.QueryOrders;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

public interface ForeHotelOrderService {
    Result buy(HashMap<String, Object> hotelHashMap, HttpSession session);


    Result findAllOrders(HttpSession session);

    Result cancelOrder(String orderId, HttpSession session);

    String toPayOrderPage(String orderId, HttpSession session, Model model);

    String doPayForOrder(HashMap<String, String> orderInfo, HttpSession session) throws AlipayApiException;

    void updateHotelOrderByEntitiy(Hotel_orders hotel_orders);

    Hotel_orders findById(String orderId);

    void updateStatusByHotelOrderId(String status, String orderId);

    void updateStockByHotelOrderId(String orderId, int stocks);

    int countByUserId(String userId);

    Result findAll(int page, int limit, HttpSession session);

    Result QueryHotelOrdersByCondition(Integer page, Integer limit, QueryOrders queryOrders, HttpSession session);


    Result arrangeAccommodation(String id, @RequestBody Hotel_orders hotel_orders , HttpSession session);

    Result determine(String orderId, HttpSession session);

    Result findByOrderId(String orderId, String emailId , HttpSession session);

    Result relet(String orderId, HashMap<String , String>hashMap , HttpSession session);
}
